/**
 * @author linyip
 */

var ProjectuseList = new  Pearlsen.BaseList(
		{
			gridId : 'projectuseGrid',
			advSearchId : 'advSearchWin',
			module : '项目主机使用情况',
			modulePath : '/pages/rms/projectuse/',
			moduleName : 'projectuse',
			idProperty : 'id',
			nameProperty : 'projectname',
			dataSetHandler : 'ProjectuseDatasetHandler',
			queryHandler : 'ProjectuseQueryHandler',
			
			 

			statuscpuaRender : function(value) {
		  var cpua1 =	Ext.getCmp("cpuavg1").getValue();
		  var cpua2 = Ext.getCmp("cpuavg2").getValue();
				var val = value;
				if(val < cpua1)
				{
					val = "<span style='color:green;'>"+val+"</span>";
				}if(val>cpua2)
				{
					val = "<span style='color:red;'>"+val+"</span>";
				}
				return val;
			},

			statuscpupRender : function(value) {
				var cpup = Ext.getCmp("cpupeak").getValue();
				var val = value;
				if(val<cpup)
				{
					val = "<span style='color:green;'>"+val+"</span>";
				}else
				{
					val = "<span style='color:red;'>"+val+"</span>";
				}
				return val;
			},
			statusmonaRender : function(value) {
			var mona1 = Ext.getCmp("monavg1").getValue();
			var mona2 = Ext.getCmp("monavg2").getValue();
				var val = value;
				if(val<mona1)
				{
					val = "<span style='color:green;'>"+val+"</span>";
				}if(val>mona2)
				{
					val = "<span style='color:red;'>"+val+"</span>";
				}
				return val;
			},
			statusmonpRender : function(value) {
				var monp = Ext.getCmp("monpeak").getValue();
				var val = value;
				
				if(val<monp)
				{
					val = "<span style='color:green;'>"+val+"</span>";
				}else
				{
					val = "<span style='color:red;'>"+val+"</span>";
				}
				return val;
			},
			statusdisRender : function(value){
				
				var val = value;
//				if(val>10 && val<80)
//				{
//					val = "<span style='color:green;'>"+val+"</span>";
//				}else
//				{
//					val = "<span style='color:red;'>"+val+"</span>";
//				}
				return val;
			},
			setThreshold : function(){
				
				this.getGrid().getStore().load();
			
			}
		

		});
